/*
 * @Author: nengwu 409791297@qq.com
 * @Date: 2020-06-28 10:14:36
 * @LastEditors: mylesshie@gmail.com
 * @LastEditTime: 2020-09-10 23:06:28
 * @description:
 */

import React from 'react'
import { Image, View, TouchableWithoutFeedback } from 'react-native'
import Swiper from 'react-native-swiper'
import styles from './styles'

const LifeSwiper = props => {

  const _createItems = () => {
    return props.list.map(item => {
      return (
        <View style={styles.slideItem} key={item.id}>
          <Image
            style={styles.slideImage}
            source={{
              uri: item.img
            }}
          />
        </View>
      )
    })
  }
  return (
    <View style={styles.wrap}>
      <Swiper
        style={styles.swiperBox}
        autoplay
        loop
      >
        {_createItems()}
      </Swiper>
    </View>
  )
}

export default LifeSwiper
